xl: Make clear distinction between "filename" and "data source"
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Tue, 15 May 2012 15:28:13 +0000 (16:28 +0100)
committerGeorge Dunlap <george.dunlap@eu.citrix.com>
Tue, 15 May 2012 15:28:13 +0000 (16:28 +0100)
commit8b9105f6d9e6716c265ca0116038b8273b1d9116
tree47ac6bc1787be0b023fa6daed6a283b03a5bc051
parentf77723ad33a89f48ddcd5dcd628a8061fb41d18b
xl: Make clear distinction between "filename" and "data source"

Many places in xl there's a variable or element named "filename" which
does not contain a filename, but the source of the data for reporting
purposes.  Worse, there are variables which are sometimes actually
used or interpreted as a filename depending on what other variables
are set.  This makes it difficult to tell when a string is purely
cosmetic, and when another bit of code may actually attempt to call
"open" with the string.

This patch makes a consistent distinction between "filename" (which
always refers to the name of an actual file, and may be interpreted as
such at some point) and "source" (which may be a filename, or may be
another data source such as a migration stream or saved data).

This does add some variables and reshuffle where assignments happen;
most notably, the "restore_filename" element of struct domain_create
is now only set when restoring from a file.

But at a high level, there should be no funcitonal changes.

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_utils.c
tools/libxl/xl_cmdimpl.c